
import javax.swing.JOptionPane;
public class Sumatoria {

    
    public static void main(String[] args) {
  


        
String a;
int x,s=0,c=1;
while (c==1){
a= JOptionPane.showInputDialog("Capture un numero");
x=Integer.parseInt(a) ;
s=s+x;
if (x==30){
c=2;
}
JOptionPane.showMessageDialog(null," la suma es "+s,"",JOptionPane.PLAIN_MESSAGE) ;
}
}
}
   
